<?php
 include "counter2.php";
?>
<?php pagehead("Linux Counter Slashdot Experience") ?>
<BODY bgcolor="white">
<?php pagetop("Linux Counter Slashdot Experience") ?>

On February 23, 1999, around 15:43 European Time, the
<a href="/">Linux Counter</a>
was <a href="http://www.slashdot.org/articles/99/02/23/1049219.shtml">
listed</a> on <a href="http://slashdot.org">Slashdot</a>.
<p>
This is a chronicle of what happened.
<p>
(For what happened the second time, look at <a href="part2/">Chapter 2</a>)
<h2>The Linux Counter Setup</h2>
The Linux Counter is a project that has been running since 1993, with
the chief aim of letting people tell the world "I use Linux".
<p>
It is currently running on a 90 MHz Pentium machine, which at the time
of Slashdot had 32 Mbytes of RAM.<br>
It is located in Norway, and its connection to the outside world is through
a 256 Kbit/second leased line. Its timezone is European (MET, +0100),
six hours ahead of the US East Coast, nine hours ahead of California.
<p>
The counter keeps rather extensive graphs of its
operation, including hourly summaries of the number of visitors, the
number of operations done, and the number of Web pages served.
<br>
The pictures were striking enough that I thought it a Good Thing to
preserve them for posterity; the
<a href="/reports/hourstats.php">running stats</a> are always available.

<h2>Number of visitors per hour, last 3 days</h2>
<img src="visitorshour.gif">
<p>
This image shows the basic phases of a Slashdotting:
<ol>
<li>Confusion
<li>Reconfiguration
<li>Return to normality
</ol>
What happened about 1 minute after the article went up was that a hundred
people tried registering, the counter tried to satisfy them, and the machine
went into trashing.<p>
Each registration operation requires a Perl script, which has about a
2-Mbyte footprint. You can imagine the result of trying to run 150 of
those at the same time.
<p>
The solution was to change Apache's "MaxClients" config variable to
approximately 1/2 of the Mbytes that could be used for scripts - 12
in this case; the true value was achieved shortly after midnight.
(The "factory" default is 150).
<br>After getting another 16 Mbytes of RAM, I've since increased it
to 20, but at that time (12 noon on the 24th), the Slashdot wave was
mostly over, so I don't know if this value is truly safe.

<h2>Number of operations per hour, last 3 days</h2>
<img src="byhour.gif">
<p>
This one graphs successful registrations. Notable is the fact that the
initial visit spike resulted in <em>no</em> successful registrations.
<br>
After the reconfig, it appears that the counter was able to serve up
to 200 requests per hour; you will notice how the visitors at midnight
were much more than at 2 AM, while the registration rate remained
constant.

<h2>Number of Web accesses per hour, last 3 days</h2>
<img src="wwwbyhour.gif">
<h2>Load on the access line</h2>
<img src="access-ut-week.gif">
<p>
The whole week embedding the slashdotting is included; you can see
what a "normal" day looks like. Green is inbound traffic, blue is outbound.
<br>
The flat segment on Tuesday is the server's downtime; the MRTG traffic
grapher runs on the same computer as the Linux Counter.
<p>
Note that even at full slashdot, normal traffic (which is heaviest
inbound, as is common for a "customer" site) was not affected.
<h2>Lessons learned</h2>
<ul>
<li>Slashdotting is good for you.<br>
The counter is now defensively configured, and is able to do something
intelligent even under heavy load.
<li>A 32-Mbyte Pentium can't fill a 256-Kbit link using Perl.<br>
I'm sure management is happy to know that.
<li>The adrenaline kick of a slashdotting feels <em>real</em> good!
<br>
But it does eat time...I spent 4 hours Tuesday night getting the box
reconfigured and back on its feet, and then just watching it. Late.
<li>On Wednesday, 1412 people registered with the counter.
</ul>
Go to <a href="part2/">The Slashdot Experience, Part 2</a>

<?php pagebottom() ?>
</body>
</html>
